//使用new来创建数组
#include <iostream>
int main_cppArray()
{
 using namespace std;
 int *p1 = new int[3];
 p1[0] = 2000;
 p1[1] = 2001;
 p1[2] = 2002;
 cout << "p1[0]=" << p1[0] << " p1[0] by ponter=" << *p1 << endl;
 cout << "p1 add 1:" << endl;
 int *p2 = p1 + 1;
 cout << "p2[0] =" << p2[0] << endl;
 cout << "p2[1] =" << p2[1] << endl;
 p2 = p2 - 1;
 cout << "p1 subtraction  1:" << endl;
 cout << "p2[0] =" << p2[0] << endl;
 cout << "p2[1] =" << p2[1] << endl;
 delete [] p1;
 /*
  out put:
    p1[0]=2000 p1[0] by ponter=2000
    p1 add 1:
    p2[0] =2001
    p2[1] =2002
    p1 subtraction  1:
    p2[0] =2000
    p2[1] =2001
 */
 return 0;
}
